package ae.pcfc.etks.online.itworx.ehs.web.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import ae.pcfc.etks.online.itworx.ehs.web.enums.RequestStatus;
import ae.pcfc.etks.online.itworx.ehs.web.enums.UserType;


@Entity
@Table(name = "T_EHS_OFC_REQUEST_HISTORY")
@SequenceGenerator(name = "EHS_OFC_REQUEST_HIST_ID_SEQ", sequenceName = "EHS_OFC_REQUEST_HIST_ID_SEQ", initialValue = 1, allocationSize = 1)
public class OFCRequestHistory extends AuditableEntity implements Serializable {
	
	@Id
	@Column(name = "EHS_OFC_REQUEST_HISTORY_ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "EHS_OFC_REQUEST_HIST_ID_SEQ")
	private Long id;
	@Column(name = "REQ_COMMENT", length = 50)
	private String comments;
	@Column(name = "OFFICER_COMMENT", length = 50)
	private String officerComments;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "PROCESSING_DATE")
	private Date processingDate;
	@Column(name = "USER_ID", nullable = false, length = 50)
	private String userId;
	@Column(name = "OFFICER_ID", length = 50)
	private String officerId;
	@Column(name = "STATUS", nullable = false, length = 50)
	@Enumerated(EnumType.STRING)
	private RequestStatus status;
	@Transient
	private String userName;
	@Column(name = "EXECUTER", nullable = false, length = 50)
	@Enumerated(EnumType.STRING)
	private UserType executer;

	public UserType getExecuter() {
		return executer;
	}

	public void setExecuter(UserType executer) {
		this.executer = executer;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Long getId() {
		return id;
	}

	public void setHistoryId(Long id) {
		this.id = id;
	}
	
	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public String getOfficerComments() {
		return officerComments;
	}

	public void setOfficerComments(String officerComments) {
		this.officerComments = officerComments;
	}
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getOfficerId() {
		return officerId;
	}

	public void setOfficerId(String officerId) {
		this.officerId = officerId;
	}

	public RequestStatus getStatus() {
		return status;
	}

	public void setStatus(RequestStatus status) {
		this.status = status;
	}
	
	public Date getProcessingDate() {
		return processingDate;
	}

	public void setProcessingDate(Date processingDate) {
		this.processingDate = processingDate;
	}

}
